#ifndef ALIYUN_ACS_RESPONSE_H_
#define ALIYUN_ACS_RESPONSE_H_

#include <map>
#include <vector>
#include "core/utils/string_helper.h"
#include "core/aliyun_types.h"

namespace aliyun {

class AcsResponse {
public:
  AcsResponse();
  virtual ~AcsResponse();

  const string& GetCode(void) const;
  void SetCode(const string& code);

  const string& GetMessage(void) const;
  void SetMessage(const string& message);

  const string& GetRequestId(void) const;
  void SetRequestId(const string& request_id);

  const string& GetHostId(void) const;
  void SetHostId(const string& host_id);

  virtual void ParseBody(const unsigned char* body, size_t body_length, bool is_success, const string& format);

protected:
  virtual const char* BaseKey(void);
  virtual void UnmarshallerMap(std::map<string, string>& response_map);

  void UnmarshallerString(string& unmarshaller, std::map<string,string>& response_map, const string& path);
  void UnmarshallerBool(bool& unmarshaller, std::map<string,string>& response_map, const string& path);
  void UnmarshallerInt(int& unmarshaller, std::map<string,string>& response_map, const string& path);
  void UnmarshallerInt64(int64& unmarshaller, std::map<string,string>& response_map, const string& path);
  void UnmarshallerFloat(float& unmarshaller, std::map<string,string>& response_map, const string& path);

protected:
  string request_id_;
  string host_id_;
  string code_;
  string message_;
};

} // namespace aliyun {

#endif // #ifndef ALIYUN_ACS_RESPONSE_H_

// end of file
